package cn.wusifx.zabbix.request.builder.host;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.RequestBuilder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/hostinterface/massremove
 */
public class HostInterfaceMassRemoveRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private List<String> hostIds;
    private List<Map<String,Object>> interfaces;
    public HostInterfaceMassRemoveRequestBuilder(String auth) {
        super("hostinterface.massremove", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public HostInterfaceMassRemoveRequestBuilder(Long id, String auth) {
        super("hostinterface.massremove", id, auth);
        builder().setParams(new HashMap<>());
    }

    public HostInterfaceMassRemoveRequestBuilder setParam(String key, Object value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public HostInterfaceMassRemoveRequestBuilder setParams(Map<String,Object> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    public List<String> getHostIds() {
        return hostIds;
    }

    public HostInterfaceMassRemoveRequestBuilder setHostIds(List<String> hostIds) {
        this.hostIds = hostIds;
        return this;
    }

    public List<Map<String, Object>> getInterfaces() {
        return interfaces;
    }

    public HostInterfaceMassRemoveRequestBuilder setInterfaces(List<Map<String, Object>> interfaces) {
        this.interfaces = interfaces;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("hostids",hostIds);
        baseRequest.getParams().put("interfaces",interfaces);
        return baseRequest;
    }
}
